from urllib import request
import socket
url = 'http://www.baidu.com/'
try:
    response = request.urlopen(url,timeout=0.001)
except socket.timeout as e:
    print(e)
print('other action')
